package com.e3.sysmg.security.client;

import java.util.ArrayList;
import java.util.List;

import com.e3.sysmg.security.model.ModuleModel;
import com.e3.template.tgf.TGFSimpleFormPanel;
import com.extjs.gxt.ui.client.widget.form.Field;
/**
 * 显示Module的详细信息。
 * @author Janty
 *
 */
public class ModuleFormPanel extends TGFSimpleFormPanel<ModuleModel>{

	@Override
	public List<Field<?>> getFormFields() {
		String[] names = {ModuleModel.ID,ModuleModel.CODE,ModuleModel.NAME,ModuleModel.PATH,ModuleModel.PARENT_MODULE,ModuleModel.STATUS};
		List<Field<?>> fields = new ArrayList<Field<?>>(names.length);
		for (String name : names) {
			Field<?> formField = ModuleHelper.INSTANCE.createFormField(name);
			fields.add(formField);
		}
		return fields;
	}

	@Override
	public ModuleModel createModelInstance() {
		return ModuleHelper.INSTANCE.createModelInstance();
	}
	

}
